package com.wangxin.study8.spring;

import org.springframework.core.io.*;

/**
 * @author jojo.wang
 * @title: DefaultResourceLoaderITest
 * @projectName study8
 * @description: TODO
 * @date 2019/4/2816:13
 */

public class DefaultResourceLoaderITest {
    public static void main(String[] args) {
        ResourceLoader resourceLoader = new DefaultResourceLoader();
        Resource file1 = resourceLoader.getResource("D:/spring/vulcan/summary.md");
        System.out.println("file1 is FileSystemResource:"+(file1 instanceof FileSystemResource));

        Resource file2 = resourceLoader.getResource("/spring/vulcan/summary.md");
        System.out.println("file2 is ClassPathResource:"+(file2 instanceof ClassPathResource));

        Resource url = resourceLoader.getResource("file:/spring/vulcan/summary.md");
        System.out.println("url is UrlResource:"+(url instanceof UrlResource));

        Resource url2 = resourceLoader.getResource("http://www.baidu.com");
        System.out.println("url2 is UrlResource:"+(url2 instanceof UrlResource));

        ResourceLoader f = new FileSystemResourceLoader();
        Resource file11 = f.getResource("D:/spring/vulcan/summary.md");
        System.out.println("file11 is FileSystemResource:"+(file11 instanceof FileSystemResource));
    }
}
